package hasthi.common.constants;

import static hasthi.common.constants.WSDMConstants.HOSTNAME_PARAM;
import static hasthi.common.constants.WSDMConstants.MUWS2_NAMESPACE;
import static hasthi.common.constants.WSDMConstants.RESOURCE_CATEGORY_PARAM;
import hasthi.common.Utils;
import hasthi.metamodel.resource.ManagedResource;

import javax.xml.namespace.QName;

public interface WSDMConstants {
    public static final String MUWS1_NAMESPACE = "http://docs.oasis-open.org/wsdm/muws1-2.xsd";
    public static final String MUWS2_NAMESPACE = "http://docs.oasis-open.org/wsdm/muws2-2.xsd";
    public static final String MUWS1_PREFIX = "muws1";
    public static final String MUWS2_PREFIX = "muws2";
    public static final String PDM_NAMESPACE = "http://docs.oasis-open.org/wsdm/muws/";
    public static final String PDM_PREFIX = "pdm";
    public static final String SERVICE_NAME = "ServiceName";
    public static final String EXTREME_MANAGEMENT_NS = "http://extreme.indiana.edu/wsdm/";

    
    /* States are broadly grouped as up, down, and repairing. If system is in repaired state the object will be removed in 2e_r time, and if it is Stopped/Crahsed states, it is
     * removed in 5e_r time. When a rule change something in a resource, the rule should set state as Repaired or Repairing. If the action failed, the state should be set to
     * UnRepairable.  
     */
    public static enum SystemState {
        BusyState, IdleState, SaturatedState, StoppedState, CrashedState, FaultyState, UnRepairableState, RepairedState,RepairingState,UpState,DownState 
    };

    // public static enum ResourceCategory{
    // Host,Service,TransientService,ComputeNode
    // }

    public static final String CAPABILITY_DESCRIPTION = "http://docs.oasis-open.org/wsdm/muws/capabilities/Description";
    public static final String CAPABILITY_STATE = "http://docs.oasis-open.org/wsdm/muws/capabilities/State";
    public static final String CAPABILITY_OPERATIONAL_STATUS = "http://docs.oasis-open.org/wsdm/muws/capabilities/OperationalStatus";
    public static final String CAPABILITY_MATRICS1 = "http://docs.oasis-open.org/wsdm/muws/capabilities/Metrics";
    //public static final String CAPABILITY_MATRICS2 = "http://docs.oasis-open.org/mows-2/capabilities/Metrics";
    public static final String CAPABILITY_OPERATIONAL_STATUS2 = "http://docs.oasis-open.org/mows-2/capabilities/OperationalState";
    public static final String CAPABILITY_REQUEST_PROCESSING_STATUS = "http://docs.oasis-open.org/mows-2/capabilities/RequestProcessingState";
    public static final String CAPABILITY_HEARTBEAT = "http://extreme.indiana.edu/wsdm/HeartBeatCapability";
    public static final String CAPABILITY_CONFIGURATION = "http://docs.oasis-open.org/wsdm/muws/capabilities/Configuration";
    public static final String CAPABILITY_METADATA = "http://extreme.indiana.edu/wsdm/Metadata";
    public static final String CAPABILITY_CATEGORY = "http://extreme.indiana.edu/wsdm/CategoryCapability";
    public static final String CAPABILITY_SHUTDOWN = "http://extreme.indiana.edu/wsdm/ShutdownCapability";
    public static final String CAPABILITY_HEALTHCHECK = "http://extreme.indiana.edu/wsdm/HealthCheckCapability";
    

    
    public static QName DESCRIPTION_PARAM = new QName(MUWS2_NAMESPACE, "Description");
    public static QName CAPTION_PARAM = new QName(MUWS2_NAMESPACE, "Caption");
    
    public static QName MANAGMENT_EVNET_SINK_PARAM = new QName(EXTREME_MANAGEMENT_NS,
            "ManagemntEventSinkEpr");
    public static QName RESOURCE_CATEGORY_PARAM = new QName(EXTREME_MANAGEMENT_NS, "Category");
    public static QName RESOURCE_TYPE_PARAM = new QName(EXTREME_MANAGEMENT_NS, "Type");
    public static QName HOSTNAME_PARAM = new QName(EXTREME_MANAGEMENT_NS, "Host");
    public static QName GROUP_PARAM = new QName(EXTREME_MANAGEMENT_NS, "group");
    public static QName RESOURCE_NAME_PARAM = new QName(EXTREME_MANAGEMENT_NS, "ResourceId");
    public static QName RESOURCE_STATUS_PARAM = new QName(MUWS2_NAMESPACE, "OperationalStatus");
    public static QName RESOURCE_MANAGEMENT_EPR_PARAM = new QName(EXTREME_MANAGEMENT_NS,
            "ManagmentEpr");
    
    public static QName CHECKPOINT_LOCATION = new QName(EXTREME_MANAGEMENT_NS,"CheckPointLocation");
    
    public static String MANAGEMENT_EVENT_SINK_PARAM = "ManagmentEventSink";

    public static final String ACTION_SHUTDOWN = "http://extreme.indiana.edu/wsdm/action/Shutdown";

    public static final String MNG_EVET_SENDER_ADDRESS_XPATH = "declare namespace muw='http://docs.oasis-open.org/wsdm/muws1-2.xsd';"
            + "declare namespace add='http://www.w3.org/2005/08/addressing';"
            + "$this//muw:ComponentAddress/add:Address";

}
